﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DotNet.Mvc;
using XNWebService;

namespace XNWebAPI.Controllers
{
    public class XNDataController : JsonController
    {
        /// <summary>
        /// 获取最新的西宁市的交通指数数据
        /// </summary>
        /// <param name="regiontype">
        /// 行政区划代码：630104---城西\630102---城东\630103---城中\630105---城北\630100---西宁市
        /// </param>
        public ActionResult GetTrafficIndexData(string regiontype)
        {
            var data = ApiService.GetTrafficIndexData(regiontype);
            return Json(data);
        }

        /// <summary>
        /// 获取最新的分区域交通指数信息,返回结果以行政区划（regiontype）由小到大排序
        /// </summary>
        public ActionResult GetRegionalTransportationIndex()
        {
            var data = ApiService.GetRegionalTransportationIndex();
            return Json(data);
        }

        /// <summary>
        /// 获取最新的主要道路行程速度信息,以当前速度（currspeed）按由小到大排序
        /// </summary>
        /// <param name="rlevel">道路等级[1:主干线\2:次干线]</param>
        public ActionResult GetMainRoadTravelSpeed(string rlevel)
        {
            var data = ApiService.GetMainRoadTravelSpeed(rlevel);
            return Json(data);
        }

        /// <summary>
        /// 查询出最近时刻出租车的空驶数量、载客数量及停驶的数量信息
        /// </summary>
        public ActionResult GetLastStatusNum()
        {
            var data = ApiService.GetLastStatusNum();
            return Json(data);
        }


        /// <summary>
        /// 查询出最近时刻道路拥堵前十条数据
        /// </summary>
        /// <returns></returns>
        public ActionResult GetCongestionTopRoad()
        {
            var data = ApiService.GetCongestionTopRoad();
            return Json(data);
        }

    }
}